inherited sprStreets: TsprStreets
  HelpContext = 1154
  Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082' '#1091#1083#1080#1094
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel2: TPanel
    Top = 89
    Height = 465
    inherited PageControl1: TPageControl
      Height = 465
      inherited tsTab: TTabSheet
        inherited GroupBox3: TGroupBox
          Height = 437
          Caption = ' '#1059#1083#1080#1094#1099' '
          inherited dbgRefer: TDBGridEh
            Height = 420
            Columns = <
              item
                EditButtons = <>
                FieldName = 'ID'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'STREET'
                Footers = <>
                Width = 202
              end
              item
                EditButtons = <>
                FieldName = 'CODE'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'TOWN_ID'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'TOWN'
                Footers = <>
                Width = 188
              end
              item
                EditButtons = <>
                FieldName = 'AREA'
                Footers = <>
                Width = 165
              end
              item
                EditButtons = <>
                FieldName = 'STRTYPE'
                Footers = <>
              end>
          end
        end
      end
      inherited tsForm: TTabSheet
        inherited GroupBox2: TGroupBox
          Top = 0
          Height = 145
          object Label1: TLabel [0]
            Left = 81
            Top = 15
            Width = 17
            Height = 13
            Alignment = taRightJustify
            Caption = #1048#1044
          end
          object Label2: TLabel [1]
            Left = 48
            Top = 35
            Width = 50
            Height = 13
            Alignment = taRightJustify
            Caption = #1053#1072#1079#1074#1072#1085#1080#1077
          end
          object Label8: TLabel [2]
            Left = 47
            Top = 75
            Width = 51
            Height = 13
            Alignment = taRightJustify
            Caption = #1053#1072#1089'.'#1087#1091#1085#1082#1090
          end
          object Label3: TLabel [3]
            Left = 79
            Top = 55
            Width = 19
            Height = 13
            Alignment = taRightJustify
            Caption = #1050#1086#1076
          end
          object Label4: TLabel [4]
            Left = 45
            Top = 95
            Width = 53
            Height = 13
            Alignment = taRightJustify
            Caption = #1058#1080#1087' '#1091#1083#1080#1094#1099
          end
          inherited pnlButtons: TPanel
            Top = 112
            TabOrder = 4
          end
          object DBEditEh1: TDBEditEh
            Left = 104
            Top = 12
            Width = 57
            Height = 19
            AlwaysShowBorder = True
            Color = clInactiveCaptionText
            DataField = 'ID'
            DataSource = dscRefer
            EditButtons = <>
            Enabled = False
            Flat = True
            ReadOnly = True
            TabOrder = 0
            Visible = True
          end
          object DBEditEh2: TDBEditEh
            Left = 104
            Top = 32
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'STREET'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 1
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBLookupComboboxEh1: TDBLookupComboboxEh
            Left = 104
            Top = 72
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'TOWN_ID'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            KeyField = 'ID'
            ListField = 'NAME'
            ListSource = dscTowns
            TabOrder = 3
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh3: TDBEditEh
            Left = 104
            Top = 52
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'CODE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 2
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBLookupComboboxEh2: TDBLookupComboboxEh
            Left = 104
            Top = 92
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'TYPE_ID'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            KeyField = 'ID'
            ListField = 'NAME'
            ListSource = dscStreetTypes
            TabOrder = 5
            Visible = True
            OnChange = DBEditEhChange
          end
        end
      end
    end
  end
  inherited GroupBox1: TGroupBox
    Height = 64
    object Label10: TLabel
      Left = 56
      Top = 20
      Width = 50
      Height = 13
      Alignment = taRightJustify
      Caption = #1053#1072#1079#1074#1072#1085#1080#1077
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label11: TLabel
      Left = 12
      Top = 43
      Width = 95
      Height = 13
      Alignment = taRightJustify
      Caption = #1053#1072#1089#1077#1083#1077#1085#1085#1099#1081'.'#1087#1091#1085#1082#1090
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object eNameSearch: TEdit
      Left = 114
      Top = 16
      Width = 121
      Height = 21
      BevelInner = bvSpace
      BevelKind = bkFlat
      BorderStyle = bsNone
      Ctl3D = True
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentCtl3D = False
      ParentFont = False
      TabOrder = 0
      OnChange = eNameSearchChange
    end
    object dblTowns: TDBLookupComboboxEh
      Left = 114
      Top = 40
      Width = 122
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      KeyField = 'ID'
      ListField = 'NAME'
      ListSource = dscStreetTowns
      ParentFont = False
      TabOrder = 1
      Visible = True
      OnChange = eNameSearchChange
    end
  end
  inherited dsRefer: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE RSTREETS'
      'SET '
      '    STREET = :STREET,'
      '    CODE = :CODE,'
      '    TOWN_ID = :TOWN_ID,'
      '    TYPE_ID = :TYPE_ID'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    RSTREETS'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO RSTREETS('
      '    ID,'
      '    STREET,'
      '    CODE,'
      '    TOWN_ID,'
      '    TYPE_ID'
      ')'
      'VALUES('
      '    :ID,'
      '    :STREET,'
      '    :CODE,'
      '    :TOWN_ID,'
      '    :TYPE_ID'
      ')')
    RefreshSQL.Strings = (
      'select '
      'st.*, '
      'coalesce(tt.short_name,'#39#39')|| t.name as town,'
      
        'coalesce(ta.area_name,'#39#39') || coalesce('#39' '#39'|| ta.region,'#39#39') as are' +
        'a,'
      'rst.name as strtype'
      'from rstreets st'
      ' join pas_rtown t on st.town_id = t.code'
      ' left join pas_rtown_type tt on t.town_type_id = tt.id'
      ' left join rtown_areas ta on ta.id = t.TOWN_AREA'
      ' left join rstreets_types rst on rst.id = st.type_id'
      'where(  1 = 1'
      '     ) and (     ST.ID = :OLD_ID'
      '     )'
      '    ')
    SelectSQL.Strings = (
      'select '
      'st.*, '
      'coalesce(tt.short_name,'#39#39')|| t.name as town,'
      
        'coalesce(ta.area_name,'#39#39') || coalesce('#39' '#39'|| ta.region,'#39#39') as are' +
        'a,'
      'rst.name as strtype'
      'from rstreets st'
      ' join pas_rtown t on st.town_id = t.code'
      ' left join pas_rtown_type tt on t.town_type_id = tt.id'
      ' left join rtown_areas ta on ta.id = t.TOWN_AREA'
      ' left join rstreets_types rst on rst.id = st.type_id'
      'where 1 = 1')
    BeforeEdit = dsReferBeforeEdit
    UpdateTransaction = trRefer
    object dsReferID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
      Visible = False
    end
    object dsReferSTREET: TFIBStringField
      DisplayLabel = #1059#1083#1080#1094#1072
      FieldName = 'STREET'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferCODE: TFIBIntegerField
      DisplayLabel = #1050#1086#1076' '#1091#1083#1080#1094#1099
      FieldName = 'CODE'
    end
    object dsReferTOWN_ID: TFIBIntegerField
      DefaultExpression = '1'
      FieldName = 'TOWN_ID'
    end
    object dsReferTOWN: TFIBStringField
      DisplayLabel = #1053#1072#1089'.'#1087#1091#1085#1082#1090
      FieldName = 'TOWN'
      Size = 76
      EmptyStrToNull = True
    end
    object dsReferAREA: TFIBStringField
      DisplayLabel = #1056#1072#1081#1086#1085
      FieldName = 'AREA'
      Size = 121
      EmptyStrToNull = True
    end
    object dsReferTYPE_ID: TFIBIntegerField
      FieldName = 'TYPE_ID'
    end
    object dsReferSTRTYPE: TFIBStringField
      DisplayLabel = #1058#1080#1087' '#1091#1083#1080#1094#1099
      FieldName = 'STRTYPE'
      EmptyStrToNull = True
    end
  end
  object dsTowns: TpFIBDataSet [8]
    SelectSQL.Strings = (
      'select t.code as id, t.name'
      'from pas_rtown t'
      'where local = 1'
      'order by t.name')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 476
    Top = 165
    object dsTownsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTownsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscTowns: TDataSource [9]
    DataSet = dsTowns
    Left = 506
    Top = 165
  end
  object dsStreetTowns: TpFIBDataSet [11]
    SelectSQL.Strings = (
      'select t.code as id, t.name'
      'from pas_rtown t'
      
        'where exists(select first(1) 1 from rstreets st where st.town_id' +
        ' = t.code)'
      'order by t.id')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 476
    Top = 273
    object FIBIntegerField1: TFIBIntegerField
      FieldName = 'ID'
    end
    object FIBStringField1: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscStreetTowns: TDataSource [12]
    DataSet = dsStreetTowns
    Left = 508
    Top = 273
  end
  inherited PropStorage: TPropStorageEh
    Section = 'sprStreets'
  end
  object dsStreetTypes: TpFIBDataSet
    SelectSQL.Strings = (
      'select id, name'
      'from RSTREETS_TYPES')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 476
    Top = 303
    object dsStreetTypesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsStreetTypesNAME: TFIBStringField
      FieldName = 'NAME'
      EmptyStrToNull = True
    end
  end
  object dscStreetTypes: TDataSource
    DataSet = dsStreetTypes
    Left = 508
    Top = 303
  end
end
